|
|
|
| box, you need to put the icon back to the original using the LoadPicture() function once again. Of course, you need to set the mboolFlag variable to True again. |  | You have one remaining problem with this code. If you drop the control on the text box anyway, the DragIcon property will still be set to the no drop icon. You need to change the icon back to the original drag icon. |
|
|
| Reset the DragIcon After Dropping 1. Double-click the txtNoDrop text box and select the DragDrop() event. 2. Add the following code to this event: | | Private Sub txtNoDrop_DragDrop(Source As Control, _
x As Single, y As Single)
Source.DragIcon = LoadPicture("bullseye.ico")
mboolFlag = True
End Sub |  | It is very important that you reset the DragIcon property after dropping on a control that does not accept drops. The next time the user starts to drag the control, you want it to be back to the normal DragIcon they started with. For a completed example that shows you the DragOver events State argument, see the Drag3.frm, as shown in Figure 32.4. | | Examples Filename: Drag3.frm | | | | |
|
|
|
|
Figure 32.4
Run this example to see the DragOver events State argument. |
|
|
|
|
|
|
|